﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ExitGames.Logging;
using log4net.Config;

namespace BloxServer2012
{
    public class Server : Photon.SocketServer.ApplicationBase
    {
        public static readonly ILogger logger = LogManager.GetCurrentClassLogger();
        protected override Photon.SocketServer.PeerBase CreatePeer(Photon.SocketServer.InitRequest initRequest)
        {
            return new ServerPeer(initRequest.Protocol, initRequest.PhotonPeer);
        }

        protected override void Setup()
        {
            LogManager.SetLoggerFactory(ExitGames.Logging.Log4Net.Log4NetLoggerFactory.Instance);
            var configFileInfo = new FileInfo("log4net.config");
            XmlConfigurator.ConfigureAndWatch(configFileInfo);
            DataAccess.Connect();
        }

        protected override void TearDown()
        {
        }
    }
}
